﻿@model IEnumerable<WriterStars.Model.Order>

<div class="table-responsive">
    <table class="table table-condensed table-striped">
        <tr>
            <th>
                @Html.DisplayNameFor(model => model.User.FirstName)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.OrderInfo)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.Description)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.ExpectedPrice)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.OrderState)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.CreationDate)
            </th>
            <th></th>
        </tr>

        @foreach (var item in Model)
        {
            <tr>
                <td>
                    @Html.DisplayFor(modelItem => item.User.FirstName)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.OrderInfo)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.Description)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.ExpectedPrice)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.OrderState)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.CreationDate)
                </td>
                <td>
                    @Ajax.ActionLink("Delete", "delete", new { id = item.Id }, new AjaxOptions { HttpMethod = "POST", UpdateTargetId = "books-wrapper" })
                    @*@Html.ActionLink("Delete", "delete", new { id = item.Id })*@
                </td>
            </tr>
        }

    </table>
</div>